
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module telemetry.core.local_server</title>
<meta charset="utf-8">
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.local_server</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/local_server.py">telemetry/core/local_server.py</a></font></td></tr></table>
    <p><tt>#&nbsp;Copyright&nbsp;2014&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
#&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
#&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="collections.html">collections</a><br>
<a href="telemetry.internal.forwarders.html">telemetry.internal.forwarders</a><br>
</td><td width="25%" valign=top><a href="json.html">json</a><br>
<a href="os.html">os</a><br>
</td><td width="25%" valign=top><a href="re.html">re</a><br>
<a href="subprocess.html">subprocess</a><br>
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
<a href="telemetry.core.util.html">telemetry.core.util</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="telemetry.core.local_server.html#LocalServer">LocalServer</a>
</font></dt><dt><font face="helvetica, arial"><a href="telemetry.core.local_server.html#LocalServerBackend">LocalServerBackend</a>
</font></dt><dt><font face="helvetica, arial"><a href="telemetry.core.local_server.html#LocalServerController">LocalServerController</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="__builtin__.html#tuple">__builtin__.tuple</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="telemetry.core.local_server.html#NamedPort">NamedPort</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="LocalServer">class <strong>LocalServer</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="LocalServer-Close"><strong>Close</strong></a>(self)</dt></dl>

<dl><dt><a name="LocalServer-GetBackendStartupArgs"><strong>GetBackendStartupArgs</strong></a>(self)</dt><dd><tt>Returns&nbsp;whatever&nbsp;arguments&nbsp;are&nbsp;required&nbsp;to&nbsp;start&nbsp;up&nbsp;the&nbsp;backend</tt></dd></dl>

<dl><dt><a name="LocalServer-Start"><strong>Start</strong></a>(self, local_server_controller)</dt></dl>

<dl><dt><a name="LocalServer-__del__"><strong>__del__</strong></a>(self)</dt></dl>

<dl><dt><a name="LocalServer-__enter__"><strong>__enter__</strong></a>(self)</dt></dl>

<dl><dt><a name="LocalServer-__exit__"><strong>__exit__</strong></a>(self, *args)</dt></dl>

<dl><dt><a name="LocalServer-__init__"><strong>__init__</strong></a>(self, server_backend_class)</dt></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>is_running</strong></dt>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="LocalServerBackend">class <strong>LocalServerBackend</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="LocalServerBackend-ServeForever"><strong>ServeForever</strong></a>(self)</dt></dl>

<dl><dt><a name="LocalServerBackend-StartAndGetNamedPorts"><strong>StartAndGetNamedPorts</strong></a>(self, args)</dt><dd><tt>Starts&nbsp;the&nbsp;actual&nbsp;server&nbsp;and&nbsp;obtains&nbsp;any&nbsp;sockets&nbsp;on&nbsp;which&nbsp;it<br>
should&nbsp;listen.<br>
&nbsp;<br>
Returns&nbsp;a&nbsp;list&nbsp;of&nbsp;<a href="#NamedPort">NamedPort</a>&nbsp;on&nbsp;which&nbsp;this&nbsp;backend&nbsp;is&nbsp;listening.</tt></dd></dl>

<dl><dt><a name="LocalServerBackend-__init__"><strong>__init__</strong></a>(self)</dt></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="LocalServerController">class <strong>LocalServerController</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Manages&nbsp;the&nbsp;list&nbsp;of&nbsp;running&nbsp;servers<br>
&nbsp;<br>
This&nbsp;class&nbsp;manages&nbsp;the&nbsp;running&nbsp;servers,&nbsp;but&nbsp;also&nbsp;provides&nbsp;an&nbsp;isolation&nbsp;layer<br>
to&nbsp;prevent&nbsp;<a href="#LocalServer">LocalServer</a>&nbsp;subclasses&nbsp;from&nbsp;accessing&nbsp;the&nbsp;browser&nbsp;backend&nbsp;directly.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="LocalServerController-Close"><strong>Close</strong></a>(self)</dt></dl>

<dl><dt><a name="LocalServerController-CreateForwarder"><strong>CreateForwarder</strong></a>(self, port_pairs)</dt></dl>

<dl><dt><a name="LocalServerController-GetRemotePort"><strong>GetRemotePort</strong></a>(self, port)</dt></dl>

<dl><dt><a name="LocalServerController-GetRunningServer"><strong>GetRunningServer</strong></a>(self, server_class, default_value)</dt></dl>

<dl><dt><a name="LocalServerController-ServerDidClose"><strong>ServerDidClose</strong></a>(self, server)</dt></dl>

<dl><dt><a name="LocalServerController-StartServer"><strong>StartServer</strong></a>(self, server)</dt></dl>

<dl><dt><a name="LocalServerController-__init__"><strong>__init__</strong></a>(self, platform_backend)</dt></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>local_servers</strong></dt>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="NamedPort">class <strong>NamedPort</strong></a>(<a href="__builtin__.html#tuple">__builtin__.tuple</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt><a href="#NamedPort">NamedPort</a>(name,&nbsp;port)<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="telemetry.core.local_server.html#NamedPort">NamedPort</a></dd>
<dd><a href="__builtin__.html#tuple">__builtin__.tuple</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="NamedPort-__getnewargs__"><strong>__getnewargs__</strong></a>(self)</dt><dd><tt>Return&nbsp;self&nbsp;as&nbsp;a&nbsp;plain&nbsp;<a href="__builtin__.html#tuple">tuple</a>.&nbsp;&nbsp;Used&nbsp;by&nbsp;copy&nbsp;and&nbsp;pickle.</tt></dd></dl>

<dl><dt><a name="NamedPort-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Exclude&nbsp;the&nbsp;OrderedDict&nbsp;from&nbsp;pickling</tt></dd></dl>

<dl><dt><a name="NamedPort-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Return&nbsp;a&nbsp;nicely&nbsp;formatted&nbsp;representation&nbsp;string</tt></dd></dl>

<dl><dt><a name="NamedPort-_asdict"><strong>_asdict</strong></a>(self)</dt><dd><tt>Return&nbsp;a&nbsp;new&nbsp;OrderedDict&nbsp;which&nbsp;maps&nbsp;field&nbsp;names&nbsp;to&nbsp;their&nbsp;values</tt></dd></dl>

<dl><dt><a name="NamedPort-_replace"><strong>_replace</strong></a>(_self, **kwds)</dt><dd><tt>Return&nbsp;a&nbsp;new&nbsp;<a href="#NamedPort">NamedPort</a>&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;replacing&nbsp;specified&nbsp;fields&nbsp;with&nbsp;new&nbsp;values</tt></dd></dl>

<hr>
Class methods defined here:<br>
<dl><dt><a name="NamedPort-_make"><strong>_make</strong></a>(cls, iterable, new<font color="#909090">=&lt;built-in method __new__ of type object&gt;</font>, len<font color="#909090">=&lt;built-in function len&gt;</font>)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Make&nbsp;a&nbsp;new&nbsp;<a href="#NamedPort">NamedPort</a>&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;from&nbsp;a&nbsp;sequence&nbsp;or&nbsp;iterable</tt></dd></dl>

<hr>
Static methods defined here:<br>
<dl><dt><a name="NamedPort-__new__"><strong>__new__</strong></a>(_cls, name, port)</dt><dd><tt>Create&nbsp;new&nbsp;instance&nbsp;of&nbsp;<a href="#NamedPort">NamedPort</a>(name,&nbsp;port)</tt></dd></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>Return&nbsp;a&nbsp;new&nbsp;OrderedDict&nbsp;which&nbsp;maps&nbsp;field&nbsp;names&nbsp;to&nbsp;their&nbsp;values</tt></dd>
</dl>
<dl><dt><strong>name</strong></dt>
<dd><tt>Alias&nbsp;for&nbsp;field&nbsp;number&nbsp;0</tt></dd>
</dl>
<dl><dt><strong>port</strong></dt>
<dd><tt>Alias&nbsp;for&nbsp;field&nbsp;number&nbsp;1</tt></dd>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>_fields</strong> = ('name', 'port')</dl>

<hr>
Methods inherited from <a href="__builtin__.html#tuple">__builtin__.tuple</a>:<br>
<dl><dt><a name="NamedPort-__add__"><strong>__add__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__add__">__add__</a>(y)&nbsp;&lt;==&gt;&nbsp;x+y</tt></dd></dl>

<dl><dt><a name="NamedPort-__contains__"><strong>__contains__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__contains__">__contains__</a>(y)&nbsp;&lt;==&gt;&nbsp;y&nbsp;in&nbsp;x</tt></dd></dl>

<dl><dt><a name="NamedPort-__eq__"><strong>__eq__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__eq__">__eq__</a>(y)&nbsp;&lt;==&gt;&nbsp;x==y</tt></dd></dl>

<dl><dt><a name="NamedPort-__ge__"><strong>__ge__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__ge__">__ge__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&gt;=y</tt></dd></dl>

<dl><dt><a name="NamedPort-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>

<dl><dt><a name="NamedPort-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>

<dl><dt><a name="NamedPort-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__getslice__">__getslice__</a>(i,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
&nbsp;<br>
Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>

<dl><dt><a name="NamedPort-__gt__"><strong>__gt__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__gt__">__gt__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&gt;y</tt></dd></dl>

<dl><dt><a name="NamedPort-__hash__"><strong>__hash__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__hash__">__hash__</a>()&nbsp;&lt;==&gt;&nbsp;hash(x)</tt></dd></dl>

<dl><dt><a name="NamedPort-__iter__"><strong>__iter__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__iter__">__iter__</a>()&nbsp;&lt;==&gt;&nbsp;iter(x)</tt></dd></dl>

<dl><dt><a name="NamedPort-__le__"><strong>__le__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__le__">__le__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&lt;=y</tt></dd></dl>

<dl><dt><a name="NamedPort-__len__"><strong>__len__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__len__">__len__</a>()&nbsp;&lt;==&gt;&nbsp;len(x)</tt></dd></dl>

<dl><dt><a name="NamedPort-__lt__"><strong>__lt__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__lt__">__lt__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&lt;y</tt></dd></dl>

<dl><dt><a name="NamedPort-__mul__"><strong>__mul__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__mul__">__mul__</a>(n)&nbsp;&lt;==&gt;&nbsp;x*n</tt></dd></dl>

<dl><dt><a name="NamedPort-__ne__"><strong>__ne__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__ne__">__ne__</a>(y)&nbsp;&lt;==&gt;&nbsp;x!=y</tt></dd></dl>

<dl><dt><a name="NamedPort-__rmul__"><strong>__rmul__</strong></a>(...)</dt><dd><tt>x.<a href="#NamedPort-__rmul__">__rmul__</a>(n)&nbsp;&lt;==&gt;&nbsp;n*x</tt></dd></dl>

<dl><dt><a name="NamedPort-__sizeof__"><strong>__sizeof__</strong></a>(...)</dt><dd><tt>T.<a href="#NamedPort-__sizeof__">__sizeof__</a>()&nbsp;--&nbsp;size&nbsp;of&nbsp;T&nbsp;in&nbsp;memory,&nbsp;in&nbsp;bytes</tt></dd></dl>

<dl><dt><a name="NamedPort-count"><strong>count</strong></a>(...)</dt><dd><tt>T.<a href="#NamedPort-count">count</a>(value)&nbsp;-&gt;&nbsp;integer&nbsp;--&nbsp;return&nbsp;number&nbsp;of&nbsp;occurrences&nbsp;of&nbsp;value</tt></dd></dl>

<dl><dt><a name="NamedPort-index"><strong>index</strong></a>(...)</dt><dd><tt>T.<a href="#NamedPort-index">index</a>(value,&nbsp;[start,&nbsp;[stop]])&nbsp;-&gt;&nbsp;integer&nbsp;--&nbsp;return&nbsp;first&nbsp;index&nbsp;of&nbsp;value.<br>
Raises&nbsp;ValueError&nbsp;if&nbsp;the&nbsp;value&nbsp;is&nbsp;not&nbsp;present.</tt></dd></dl>

</td></tr></table></td></tr></table>
</body></html>